<title>用户详情</title>
<div class="layui-card layadmin-header">
    <div class="layui-breadcrumb" lay-filter="breadcrumb">
        <a lay-href="">主页</a>
        <a><cite>设置</cite></a>
        <a><cite>邮件服务</cite></a>
    </div>
</div>
<script type="text/html" template lay-url="/sys/user/get?id={{ layui.router().search.id }}" lay-type="get">
    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">查看用户详情</div>
                    <div class="layui-card-body">
                        <div class="layui-form" lay-filter="">

                            <div class="layui-form-item">
                                <!--<label class="layui-form-label">图片信息</label>-->
                                <div class="layui-form-mid">
                                    <img  class="layui-upload-img" src="{{d.data.picture}}">

                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-col-md12">
                                    <div class="layui-card">
                                        <div class="layui-card-header">拖拽上传</div>
                                        <div class="layui-card-body">
                                            <div class="layui-upload-drag" id="test-upload-drag">
                                                <i class="layui-icon"></i>
                                                <p>点击上传，或将文件拖拽到此处</p>
                                            </div>
                                            <div class="layui-upload-list">
                                                <img id="test-upload-normal-img" class="layui-upload-img">
                                                <p id="test-upload-demoText"></p>
                                            </div>
                                        </div>


                                        <button type="button" class="layui-btn" id="test-upload-change-action">开始上传
                                        </button>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">编号</label>
                                <div class="layui-form-mid">{{d.data.id}}</div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">姓名</label>
                                <div class="layui-form-mid">{{d.data.userName}}</div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">账号</label>
                                <div class="layui-form-mid">{{d.data.userAmount}}</div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">密码</label>
                                <div class="layui-form-mid">{{d.data.userPwd}}</div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">拥有角色</label>
                                <div class="layui-form-mid">
                                    {{# if(d.data.roleList){ }}
                                    {{# layui.each(d.data.roleList, function(index, item){ }}
                                    [{{ item.roleName }}]
                                    {{# }); }}
                                    {{# } else { }}
                                    ""
                                    {{# } }}

                                </div>
                            </div>

                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
</script>

<style>
    .layui-upload-img {
        width: 272px;
        height: auto;
    }
</style>
<script>
    layui.use(['admin', 'upload'], function () {
        var $ = layui.jquery
            , upload = layui.upload;

        //拖拽上传
        upload.render({
            elem: '#test-upload-drag'
            , url: '/test/upload/'
            , auto: false
            , bindAction: '#test-upload-change-action'
            , choose: function (obj) {
                //预读本地文件示例，不支持ie8
                obj.preview(function (index, file, result) {
                    $('#test-upload-normal-img').attr('src', result); //图片链接（base64）
                });
            }
            , done: function (res) {
                console.log(res)
            }
        });
    });
</script>